jQuery(document).ready(function () {
    //页面初始化
    dn.init();
});

var dn = function () {

    var charts1 = function () {
        Highcharts.chart('container', {
            chart: {
                type: 'xrange'
            },
            title: {
                text: '简易甘特图'
            },
            xAxis: {
                type: 'datetime',
                dateTimeLabelFormats: {
                    week: '%Y/%m/%d'
                }
            },
            yAxis: {
                title: {
                    text: '文件版本'
                },
                categories: ['EBOM2', 'EBOM1', 'ODS1'],
                reversed: true
            },
            tooltip: {
                dateTimeLabelFormats: {
                    day: '%Y/%m/%d'
                }
            },
            series: [{
                name: '数据文件版本比较',
                // pointPadding: 0,
                // groupPadding: 0,
                borderColor: 'gray',
                pointWidth: 20,
                data: [{
                    x: Date.UTC(2014, 10, 21),
                    x2: Date.UTC(2014, 11, 2),
                    y: 0,
                    partialFill: 0.25
                }, {
                    x: Date.UTC(2014, 11, 2),
                    x2: Date.UTC(2014, 11, 5),
                    y: 0
                }, {
                    x: Date.UTC(2014, 11, 8),
                    x2: Date.UTC(2014, 11, 9),
                    y: 2
                }, {
                    x: Date.UTC(2014, 11, 9),
                    x2: Date.UTC(2014, 11, 19),
                    y: 1
                }, {
                    x: Date.UTC(2014, 11, 10),
                    x2: Date.UTC(2014, 11, 23),
                    y: 2
                }],
                dataLabels: {
                    enabled: true
                }
            }]
        });


    }

    //初始化
    var handleInit = function () {
        charts1();
    };

    return {
        init: function () {
            handleInit();
            //            handlePortletAjax();
        },
        scrollTo: function (id) {
            App.scrollTo($('#' + id), 10)
        }
    };
}();